package com.diamond.web.listeners;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import com.diamond.web.utils.ApplicationInitUtils;

@Component
public class StartupListener implements ApplicationContextAware,ServletContextListener{	
	Logger log = Logger.getLogger(getClass()); 
	@Override
	public void setApplicationContext(ApplicationContext applicationContext)throws BeansException {
		log.info("开始初始化权限列表-------------！");
		ApplicationInitUtils.appInit(applicationContext);
		log.info("初始化权限列表完成-------------！");
	}

	@Override
	public void contextInitialized(ServletContextEvent sce) {
		
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		
	}

}
